package com.superhelper.superhelper_web.common;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

/**
 * 项目常量类
 * 
 * @author duanshao
 * 
 */
public interface Consts {

	String UTF8 = "utf-8";
	String PRODUCES = "application/json;charset=utf-8";

	Map<Long, String> CODE_CITY = new HashMap<Long, String>();

	String VERIFY_CODE = "verify_code";

	String SESSION_ADMIN = "session_admin";

	String COOKIE_ADMIN = "cookie_admin";
	/** 定义cookie存活时间为1周 */
	int MAX_AGE = 7 * 24 * 60 * 60;
	int DAY_AGE = 24 * 60 * 60;

	// redis前缀
	interface Cache {
		// 环信缓存
		String TOKEN = "esportsc_hx_token";
		String ELEME_TOKEN = "super_helper_eleme_token_";
		String SUPER_SHOP = "super_helper_shop_";
		String MT_TOKEN = "super_helper_mt_token_";
	}

	interface Key {
		String SIGN = "123456";
	}

	// 表前缀
	interface TablePrefix {
		String USER = "user_";
		String ALBUM = "album_";
		String FRIENDSHIP = "friendship_";
		String INTRO = "intro_";
		String DISCUSSION_MEMBER = "discussion_member_";
		String POSTS = "posts_";
		String REPLY = "reply_";
		String POSTS_ALBUM = "posts_album_";
		String COMMENTS = "comments_";
	}

	// 通用状态码
	interface Code {

		/** 公用的返回码 */
		// 成功
		int SUCCESS = 0;
		// 失败
		int FAIL = -1;
		// 签名错误
		int SIGN_ERROR = 1;
		// 网络链接错误
		int NET_CONN_ERROR = 2;

		// 安全错误
		int SECURE_ERROR = 3;
		// 内部错误,发生异常等
		int INTERNAL_ERROR = 4;
		// 参数错误
		int DATA_ERROR = 5;
		// 请求错误，参数不足
		int REQ_ERROR = 6;
		// 业务信息错误
		int APP_INFO_ERROR = 7;
		// 数据不存在
		int DATA_NO_FOUND = 8;

		// 网络响应错误
		int NET_READ_ERROR = 9;

		// 已点过赞
		int LIKED = 10;

		// 验证码超时
		int CODE_TIMEOUT = 11;

	}

	// 表分区的数量
	interface TablePartition {
		int USER = 8;
		int ALBUM = 8;
		int FRIENDSHIP = 8;
		int INTRO = 8;
		int DISCUSSION_MEMBER = 8;
		int REPLY = 4;
		int POSTS = 34;
		int POSTS_ALBUM = 34;
		int COMMENTS = 8;
	}

	// 环信请求方法
	interface HTTPMethod {
		String METHOD_GET = "GET";
		String METHOD_POST = "POST";
		String METHOD_PUT = "PUT";
		String METHOD_DELETE = "DELETE";
	}

	interface Roles {
		/** USER_ROLE_ORGADMIN value: orgAdmin */
		public static String USER_ROLE_ORGADMIN = "orgAdmin";

		/** USER_ROLE_APPADMIN value: appAdmin */
		public static String USER_ROLE_APPADMIN = "appAdmin";

		/** USER_ROLE_IMUSER value: imUser */
		public static String USER_ROLE_IMUSER = "imUser";
	}

	/** Cookie */
	interface Cookies {
		/** 定义cookie名字 */
		static final String COOKIE_ADMIN = "cookie_admin";
		/** 定义验证码保存在session的字符串 */
		static final String VERIFY_CODE = "verify_code";
		/** 定义cookie存活时间为: 一周 */
		static final int COOKIE_MAX_AGE = 7 * 24 * 60 * 60;
	}

	/**
	 * 订单状态
	 */
	interface OrderStatus {
		String IOS = "ios";
		String ANDROID = "android";
	}

	/**
	 * 推送信息类型
	 */
	interface MsgType {
		String TEXT = "txt";
		String IMG = "img";
		String AUDIO = "audio";
		String VIDEO = "video";
		String POSTS = "posts";
	}

	/**
	 * 应用消息订阅标识（小米）
	 */
	interface AppPush {
		String XM_ALL_IOS_USER = "xm_esports_subscription_ios";
		String XM_ALL_ANDROID_USER = "xm_esports_subscription_android";

		String XM_ALL_IOS_USER_TEST = "xm_esports_subscription_ios_test";
		String XM_ALL_ANDROID_USER_TEST = "xm_esports_subscription_android_test";
	}
}
